<?php
include('../../include/functions.inc.php');
include('../../include/inputbuilder.inc.php');
include('../../include/maintenance.inc.php');
if (isEmpty(getParam('ID'))) {
    echo 'WRONG PARAMETER';
} else {
    $maintenance = unserialize($_SESSION['mPerfil']);
    $rows = $db->query_select($maintenance->table, sprintf("ID=%s", getParam('ID')));
    foreach ($rows as $row) {
        ?>
        <form id="<?php echo $maintenance->formName; ?>" name="<?php echo $maintenance->formName; ?>" method="POST" action="<?php echo $maintenance->updateUrlPage; ?>">
            <table class=""  width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <th scope="col"><legend>DATOS PERFIL</legend></th>
                    <th scope="col">
                        <legend>
                            <div style="margin-left: 30%" class="btn-group">
                                <input type="button" name="opciones" id="politicas"  class="btn btn-info"
                                onclick="javascript:loadLocal('../menuconfig/SelectMenu1.php','PERFIL=<?php echo $row['ID']; ?>');" value="Editar permisos" />
                                <input type="button" name="cmdOk" class="btn btn-info" id="cmdOk" value="Guardar" onClick="javascript:formOkBt($(this.form),updateAction);" />
                                <input type="button" name="eliminar" id="eliminar" 
                                class="btn btn-info"  onclick="javascript:deleteAction('<?php echo $maintenance->deleteUrlPage; ?>',<?php echo $maintenance->getDeleteUrl(); ?>)" value="Eliminar" />
                                <input type="button" class="btn btn-info" name="cmdCancel" id="cmdCancel" value="Cancelar" onClick="loadTable();jQuery('#cmAddcontainer').show();" />
                            </div>
                        </legend>
                    </th>
                </tr>
                <tr>
                    <td colspan="2"><br/><table width="100%" border="0" cellspacing="0" cellpadding="0">

                            <tr>
                                <td width="15%">NOMBRE</td>
                                <td width="85%"><input name="NAME" type="text" id="NAME" value="<?php echo $row['NAME']; ?>" />          </td>
                            </tr>
                            <tr>
                                <td>* ESTADO</td>
                                <td><select name="STATUS" id="STATUS">
                                        <option value="1" <?php
        if (!(strcmp(1, $row['STATUS']))) {
            echo "selected=\"selected\"";
        }
        ?>>Activo</option>
                                        <option value="0" <?php
        if (!(strcmp(0, $row['STATUS']))) {
            echo "selected=\"selected\"";
        }
        ?>>Inactivo</option>



                                    </select>
                                    <input name="ID" type="hidden" id="ID" value="<?php echo $row['ID']; ?>" /></td>
                            </tr>
                        </table></td>
                </tr>
            </table>
        </form>  
        <?php
    }
}
?>
